_zimfw_compile() {
  # Array with unique dirs. ${ZIM_HOME} or any subdirectory should only occur once.
  local -Ur zscriptdirs=(${ZIM_HOME} ${${_zdirs##${ZIM_HOME}/*}:A})
  # Compile Zim scripts
  local zfile
  for zfile in ${^zscriptdirs}/(^*test*/)#*.zsh(|-theme)(N-.); do
    if [[ ! ${zfile}.zwc -nt ${zfile} ]]; then
      zcompile -R ${zfile} && _zimfw_print -PR "<%= okay %>%B${zfile}.zwc:%b Compiled"
    fi
  done
  _zimfw_print -P '<%= done %>Done with compile.'
}
